import { channelsType } from '@/store/reducer/channels';
import request from '@/utils/request';
// 获取所有频道列表
export const getAllChannelsAPI = () => {
  return request({
    url: `/v1_0/channels`,
  });
};
// 获取用户频道列表
export const getuserChannelsAPI = () => {
  return request({
    url: `/v1_0/user/channels`,
  });
};
export type ChannelParamsType = { channels: channelsType[] };
/** 设置用户关注的频道 */
export const setUserChannelsAPI = (data: ChannelParamsType) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'PATCH',
    data,
  });
};

/** 删除用户关注的频道 */
export const delUserChannelsAPI = (id: number) => {
  return request({
    url: `/v1_0/user/channels/${id}`,
    method: 'delete',
  });
};
